<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex logOutReason_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-stretch justify-between logOutReason_fd0_0'>
					<view class='flex flex-wrap align-center logOutReason_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  logOutReason_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='logOutReason_fd0_0_c1_c0'>{{$t('注销账号')}}</text>
					</view>
					<view class='flex align-center justify-end logOutReason_fd0_0_c2'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view class="loading_css" v-if="isShow">
				<u-loading size="36" color="#3090FF"></u-loading>
				<view>加载中</view>
			</view>
			
			<!---注销账号原因-带图flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch logOutReason_flex_1" v-else>
				<view class='flex flex-wrap align-center logOutReason_fd1_0'>
					<text class='logOutReason_fd1_0_c0'>{{$t('账号注销')}}</text>
				</view>
				<text class='logOutReason_fd1_1'>{{$t('永久注销且无法恢复，请谨慎操作')}}</text>
				<view class='flex flex-wrap align-center logOutReason_fd1_2'>
					<text class='logOutReason_fd1_0_c0'>{{$t('请选择注销账号的原因：')}}</text>
				</view>
				<view class='flex flex-direction flex-wrap align-stretch'>
					<benben-select-diy ref="showSelectPopup1686883023515"
						class-name='flex flex-direction align-stretch flex' :items.sync="dataMessage" v-model="changeId"
						default-type="aid" default-label="name" :allow-cancel='false' type="radio" :disabled='false' @change="changeType">
						<template v-for='(item,key0) in dataMessage'>
							<view v-if="item.isSelected" class='flex align-center flex logOutReason_fd1_0' :key="key0"
								@tap="$refs.showSelectPopup1686883023515.tapHandle(key0)">
								<image class='logOutReason_fd1_3_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"3.png"'>
								</image>
								<text class='logOutReason_fd1_1'>{{item.name}}</text>
							</view>
							<view v-else class='flex align-center flex logOutReason_fd1_0' :key="key0"
								@tap="$refs.showSelectPopup1686883023515.tapHandle(key0)">
								<image class='logOutReason_fd1_3_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"229.png"'>
								</image>
								<text class='logOutReason_fd1_1'>{{item.name}}</text>
							</view>
						</template></benben-select-diy>
				</view>
				<text class='logOutReason_fd1_4'>{{$t('请填写注销原因')}}</text>
				<view class='flex flex-wrap logOutReason_fd1_5'>
					<textarea class='flex logOutReason_input_fd1_5' confirm-type="done" :placeholder="$t('请输入')"
						:maxlength="240" placeholder-style="color:#999;font-size:28rpx" v-model="body" />

				</view>
				<button class='flex-sub logOutReason_fd1_6' @tap.stop="goRichFunc">{{$t('下一步')}}</button>
			</view>

			<!---注销账号原因-带图flex布局结束-->


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"changeId": "",
				"changeName": "",
				"dataMessage": [],
				"body": "",
				"isShow": true,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getReasonFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//跳转风险
			goRichFunc() {
				if (!validate(this.changeId, 'require')) {
					this.$message.info(global.i18n.t('请选择注销原因'));
					return false;
				}
				if (!validate(this.body, 'require')) {
					this.$message.info(global.i18n.t('请填写注销原因'));
					return false;
				}
				this.$urouter.redirectTo(
					`/pages/xtsz/logOutRisk/logOutRisk?cancel_type=${this.changeName}&cancel_reason=${this.body}`);
			},
			changeType(e) {
				this.changeName = e.value;
			},
			//获取注销原因
			async getReasonFunc() {
				//请求方法
				//数据验证

				let datadataMessage = await this.$api.get(global.apiUrls.post656f152f10a6f, {

				});
				this.isShow = false;
				if (datadataMessage.data.code != 1) {
					this.$message.info(datadataMessage.data.msg);
					return
				}
				let infodataMessage = datadataMessage.data;
				this.dataMessage = infodataMessage.data.reason
				
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.logOutReason_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.logOutReason_fd0_0_c2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
		width: 100rpx;
	}

	.logOutReason_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.logOutReason_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333;
	}

	.logOutReason_fd0_0_c0 {
		width: 100rpx;
	}

	.logOutReason_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.logOutReason_flex_1 {
		background: #fff;
		font-size: 32rpx;
		background-size: 100% auto !important;
		padding: 0rpx 32rpx 180rpx 32rpx;
	}

	.logOutReason_fd1_6 {
		background: var(--benbenbgColor0);
		font-size: 32rpx;
		color: #fff;
		margin: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
		line-height: 88rpx;
		width: 686rpx;
		position: fixed;
		left: 0rpx;
		bottom: calc(40rpx + var(--window-bottom));
		border-radius: 8rpx;
	}

	.logOutReason_input_fd1_5 {
		background: #F5F5F8;
		width: 100%;
		height: 106rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor0);
		background-size: 100% auto;
		border-radius: 16rpx;
		padding: 32rpx 24rpx 32rpx 24rpx;
	}

	.logOutReason_fd1_5 {
		// border-bottom: 1px solid rgba(237, 237, 237, 1);
		width: 686rpx;
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		margin: 24rpx 0rpx 0rpx 0rpx;
	}

	.logOutReason_fd1_4 {
		border-top: 1px solid #eee;
		line-height: 0rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(255, 58, 58, 1);
		padding: 48rpx 0rpx 24rpx 0rpx;
		margin: 32rpx 0rpx 0rpx 0rpx;
	}

	.logOutReason_fd1_3_c0_c0_c0 {
		width: 36rpx;
		height: 36rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 20rpx 0rpx 0rpx;
	}

	.logOutReason_fd1_2 {
		border-top: 1px solid rgba(237, 237, 237, 1);
		padding: 32rpx 0rpx 12rpx 0rpx;
		margin: 32rpx 0rpx 0rpx 0rpx;
	}

	.logOutReason_fd1_1 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 500;
		color: var(--benbenFontColor0);
	}

	.logOutReason_fd1_0_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 700;
		color: var(--benbenFontColor0);
	}

	.logOutReason_fd1_0 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}
</style>